<?php
/*
    Dill is a tool for creating websites with PHP.
    Copyright (C) 2014  Jannik Haberbosch

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

// DILL LANGUAGES
define( "LANG_DE", "lang_de.php" );
define( "LANG_EN", "lang_en.php" );
define( "LANG_HU", "lang_hu.php" );


// TOOL INFORMATION
define( "PROJECT_NAME", "dill" );
define( "PROJECT_TITLE", "Dill" );
define( "PROJECT_AUTHOR", "Jannik Haberbosch" );
define( "PROJECT_VERSION", "0.01" );


// DILL ROOT DIRECTORY
define( "DILLROOT", getcwd() );


// DIRECTORIES OF A DILL WEBSITE PROJECT DIRECTORY.
define( "RELPATH_IN", implode( DIRECTORY_SEPARATOR, array( "in" ) ) );
define( "RELPATH_IN_MODULES", implode( DIRECTORY_SEPARATOR, array( "in", "modules" ) ) );
define( "RELPATH_IN_PAGES", implode( DIRECTORY_SEPARATOR, array( "in", "pages" ) ) );
define( "RELPATH_IN_TEMPLATES", implode( DIRECTORY_SEPARATOR, array( "in", "templates" ) ) );
define( "RELPATH_IN_CSS", implode( DIRECTORY_SEPARATOR, array( "in", "css" ) ) );
define( "RELPATH_IN_JS", implode( DIRECTORY_SEPARATOR, array( "in", "js" ) ) );
define( "RELPATH_IN_DOWNLOADS", implode( DIRECTORY_SEPARATOR, array( "in", "downloads" ) ) );
define( "RELPATH_IN_MEDIA", implode( DIRECTORY_SEPARATOR, array( "in", "media" ) ) );
define( "RELPATH_OUT", implode( DIRECTORY_SEPARATOR, array( "out" ) ) );
define( "RELPATH_OUT_PAGES", implode( DIRECTORY_SEPARATOR, array( "out", "pages" ) ) );
define( "RELPATH_OUT_CSS", implode( DIRECTORY_SEPARATOR, array( "out", "css" ) ) );
define( "RELPATH_OUT_JS", implode( DIRECTORY_SEPARATOR, array( "out", "js" ) ) );
define( "RELPATH_OUT_DOWNLOADS", implode( DIRECTORY_SEPARATOR, array( "out", "downloads" ) ) );
define( "RELPATH_OUT_MEDIA", implode( DIRECTORY_SEPARATOR, array( "out", "media" ) ) );
define( "RELPATH_VERSIONS", implode( DIRECTORY_SEPARATOR, array( "versions" ) ) );
define( "RELPATH_IN_DATABASE", implode( DIRECTORY_SEPARATOR, array( "in", "database" ) ) );

define( "RELPATH_BACKUPS", implode( DIRECTORY_SEPARATOR, array( "backups" ) ) );
define( "RELPATH_DATABASE", implode( DIRECTORY_SEPARATOR, array( "database" ) ) );
define( "RELPATH_MODULES", implode( DIRECTORY_SEPARATOR, array( "modules" ) ) );
define( "RELPATH_TEMPLATES", implode( DIRECTORY_SEPARATOR, array( "templates" ) ) );

// DATABASE
define( "DB_NAME", "db.sqlite" );
define(
	"DB_CREATE_TABLE_TEMPLATE",
	"CREATE TABLE template (
		id INTEGER PRIMARY KEY AUTOINCREMENT,
		name TEXT
	)"
);
define(
	"DB_CREATE_TABLE_PAGE",
	"CREATE TABLE page (
		id INTEGER PRIMARY KEY AUTOINCREMENT,
		name TEXT,
		template TEXT,
		parent_id INTEGER REFERENCES page( id ) ON DELETE CASCADE,
		sort_id INTEGER
	)"
);
define(
	"DB_CREATE_TABLE_CONTAINER",
	"CREATE TABLE container (
		id INTEGER PRIMARY KEY AUTOINCREMENT,
		name TEXT,
		content TEXT,
		page_id INTEGER REFERENCES page( id ) ON DELETE CASCADE
	)"
);


// ABSOLUTE PATHS TO IMPORTANT DIRECTORIES OF DILL.
define(
	"ABSPATH_WEBSITE_PROJECTS",
	implode(
		DIRECTORY_SEPARATOR,
		array(
			DILLROOT,
			"website_projects"
		)
	)
);


//
// The filename of each generated ".html" page:
//
define( "PAGE_NAME", "index.html" );


//
// The filename of the standard template of each website project.
//
define( "WEBSITE_PROJECT_STANDARD_TEMPLATE", "standard.html" );


//
// The filename of the website structure file.
define( "WEBSITE_STRUCTURE_FILE", "website_structure.txt" );
//


//
// Regular expressions for detecting and extracting content and function containers.
//
define( "REGEX_PAGE_CONTAINER", "/\\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*[\(]*[a-zA-Z0-9_ \(\),=]*[\)]*/" );
define( "REGEX_FUNCTION_CONTAINER", "/_[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\([a-zA-Z0-9_\x7f-\xff ,\=\"\']*\)/" );

// OTHER REGULAR EXPRESSIONS.
define( "REGEX_DIRECTORY_NAME", "/[a-zA-Z0-9_]+/" );
define( "REGEX_FILE_NAME", "/[a-zA-Z0-9_]+$/" );


//
// Definition of file extensions of files used throughout the entire program.
//
define( "EXT_PHP", ".php" );
define( "EXT_HTML", ".html" );
define( "FILEENDING_TEMPLATE", ".html" );
define( "FILEENDING_CSS", ".css" );
define( "FILEENDING_JS", ".js" );
define( "FILEENDING_MODULE", ".php" );
define( "FILEENDING_CONTAINER", ".txt" );
define( "EXT_TXT", ".txt" );


//
// Defining the separator string used inside the website structure file.
//
define( "WEBSITE_STRUCTURE_SEPARATOR_STRING", "|" );


//
// The name of the template info file inside each page directory of a website project.
//
define( "TEMPLATE_INFO_FILE", "template_info.txt" );


// ID's for wxWidgets.
define( "WXID_MENU_MAIN_WINDOW_FILE_NEW_PROJECT", 1 );
define( "WXID_MENU_MAIN_WINDOW_FILE_OPEN_PROJECT", 2 );
define(	"WXID_MENU_MAIN_WINDOW_PROJECT_MANAGE_TEMPLATES", 3 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_MANAGE_MODULES", 4 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_MANAGE_JAVASCRIPT", 5 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_MANAGE_CSS", 6 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_GENERATEWEBSITE", 7 );
define( "WXID_MENU_MAIN_WINDOW_HELP", 8 );
define( "WXID_MENU_MAIN_WINDOW_HELP_HELP", 9 );
define( "WXID_MENU_MAIN_WINDOW_HELP_ABOUT", 10 );
define( "WXID_MAIN_WINDOW_WEBSITE_STRUCTURE", 11 );
define( "WXID_MAIN_WINDOW_WEBSITE_STRUCTURE_STATICTEXT", 12 );
define( "WXID_WXLISTBOX_MAIN_WINDOW_CONTAINERS", 13 );
define( "WXID_STATICTEXT_MAIN_WINDOW_CONTAINERS", 14 );
define( "WXID_STATICTEXT_MAIN_WINDOW_TEMPLATES", 15 );
define( "WXID_WXLISTBOX_MAIN_WINDOW_TEMPLATES", 16 );
define( "WXID_WXSTATICTEXT_MAIN_WINDOW_MODULES", 17 );
define( "WXID_WXLISTBOX_MAIN_WINDOW_MODULES", 18 );
define( "WXID_WXSTATICTEXT_MAIN_WINDOW_JAVASCRIPT", 19 );
define( "WXID_WXLISTBOX_MAIN_WINDOW_JAVSCRIPT", 20 );
define( "WXID_WXSTATICTEXT_MAIN_WINDOW_CSS", 21 );
define( "WXID_WXLISTBOX_MAIN_WINDOW_JAVASCRIPT", 22 );
define( "WXID_WXSTATICTEXT_MAIN_WINDOW_EDITOR", 23 );
define( "WXID_WXTEXTCTRL_MAIN_WINDOW_EDITOR", 24 );
define( "WXID_WXBUTTON_MAIN_WINDOW_SAVE", 25 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_CLOSE", 26 );
define( "WXID_WXDIALOG_MANAGE_TEMPLATES", 27 );
define( "WXID_WXLISTBOX_MANAGE_TEMPLATES", 28 );
define( "WXID_WXBUTTON_MANAGE_TEMPLATES_ADD_TEMPLATE", 29 );
define( "WXID_WXBUTTON_MANAGE_TEMPLATES_RENAME_TEMPLATE", 30 );
define( "WXID_WXBUTTON_MANAGE_TEMPLATES_DELETE_TEMPLATE", 31 );
define( "WXID_WXDIALOG_MANAGE_MODULES", 32 );
define( "WXID_WXBUTTON_MANAGE_MODULES_ADD_MODULE", 33 );
define( "WXID_WXBUTTON_MANAGE_MODULES_RENAME_MODULE", 34 );
define( "WXID_WXBUTTON_MANAGE_MODULES_DELETE_MODULE", 35 );
define( "WXID_WXLISTBOX_MANAGE_MODULES", 36 );
define( "WXID_WXDIALOG_MANAGE_JAVASCRIPT", 37 );
define( "WXID_WXLISTBOX_MANAGE_JAVASCRIPT", 38 );
define( "WXID_WXBUTTON_MANAGE_JAVASCRIPT_ADD_JAVASCRIPT", 39 );
define( "WXID_WXBUTTON_MANAGE_JAVASCRIPT_RENAME_JAVASCRIPT", 40 );
define( "WXID_WXBUTTON_MANAGE_JAVASCRIPT_DELETE_JAVASCRIPT", 41 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_MANAGE_WEBSITE_STRUCTURE", 42 );
define( "WXID_WXDIALOG_MANAGE_CSS", 43 );
define( "WXID_WXLISTBOX_MANAGE_CSS", 44 );
define( "WXID_WXBUTTON_MANAGE_CSS_ADD_CSS", 45 );
define( "WXID_WXBUTTON_MANAGE_CSS_RENAME_CSS", 46 );
define( "WXID_WXBUTTON_MANAGE_CSS_DELETE_CSS", 47 );
define( "WXID_WXDIALOG_MANAGE_WEBSITE_STRUCTURE", 48 );
define( "WXID_WXTREECTRL_MANAGE_WEBSITE_STRUCTURE", 49 );
define( "WXID_WXBUTTON_MANAGE_WEBSITE_STRUCTURE_ADD_ITEM", 50 );
define( "WXID_WXBUTTON_MANAGE_WEBSITE_STRUCTURE_RENAME_ITEM", 51 );
define( "WXID_WXBUTTON_MANAGE_WEBSITE_STRUCTURE_DELETE_ITEM", 52 );
define( "WXID_WXBUTTON_MANAGE_WEBSITE_STRUCTURE_MOVE_UP_ITEM", 53 );
define( "WXID_WXBUTTON_MANAGE_WEBSITE_STRUCTURE_MOVE_DOWN_ITEM", 54 );
define( "WXID_WXBUTTON_MANAGE_WEBSITE_STRUCTURE_RELOCATE_ITEMTREE", 55 );
define( "WXID_WXDIALOG_MANAGE_WEBSITE_STRUCTURE_RELOCATE_ITEMTREE", 56 );
define( "WXID_WXTREECTRL_MANAGE_WEBSITE_STRUCTURE_RELOCATE_ITEMTREE", 57 );
define( "WXID_WXTEXTCTRL_MANAGE_WEBSITE_STRUCTURE_ADD_ITEM_PAGENAME", 58 );
define( "WXID_WXCHOICE_MANAGE_WEBSITE_STRUCTURE_ADD_ITEM_TEMPLATE", 59 );
define( "ID_WXDIALOG_MANAGE_WEBSITE_STRUCTURE_ADD_ITEM", 60 );
define( "WXID_WXBUTTON_MANAGE_WEBSITE_STRUCTURE_CHANGE_TEMPLATE", 61 );
define( "WXID_MAIN_WINDOW_WEBSITE_STRUCTURE_TEMPLATE_USED_HEADING", 62 );
define( "WXID_MAIN_WINDOW_WEBSITE_STRUCTURE_TEMPLATE_USED", 63 );
define( "WXID_WXSTATICTEXT_MANAGE_WEBSITE_STRUCTURE_TEMPLATE_USED_CAPTION", 64 );
define( "WXID_WXSTATICTEXT_MANAGE_WEBSITE_STRUCTURE_TEMPLATE_USED", 65 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_MANAGE_MEDIA", 66 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_MANAGE_DOWNLOADS", 67 );
define( "WXID_WXSTATICTEXT_MAIN_WINDOW_MEDIA", 68 );
define( "WXID_WXDATAVIEWTREECTRL_MAIN_WINDOW_MEDIA", 69 );
define( "WXID_WXSTATICTEXT_MAIN_WINDOW_DOWNLOADS", 70 );
define( "WXID_WXDATAVIEWTREECTRL_MAIN_WINDOW_DOWNLOADS", 71 );
define( "WXID_WXDIALOG_MANAGE_MEDIA_DOWNLOADS", 72 );
define( "WXID_WXDATAVIEWTREECTRL_MANAGE_MEDIA_DOWNLOADS", 73 );
define( "WXID_WXBUTTON_MANAGE_MEDIA_DOWNLOADS_ADD", 74 );
define( "WXID_WXBUTTON_MANAGE_MEDIA_DOWNLOADS_ADD_DIRECTORY", 75 );
define( "WXID_WXBUTTON_MANAGE_MEDIA_DOWNLOADS_DELETE", 76 );
define( "WXID_WXBUTTON_MANAGE_MEDIA_DOWNLOADS_RENAME", 77 );
define( "WXID_WXDIALOG_MANAGE_MEDIA", 78 );
define( "WXID_WXDATAVIEWTREECTRL_MANAGE_MEDIA", 79 );
define( "WXID_WXBUTTON_MANAGE_MEDIA_ADD_FILE", 80 );
define( "WXID_WXBUTTON_MANAGE_MEDIA_RENAME", 81 );
define( "WXID_WXBUTTON_MANAGE_MEDIA_DELETE", 82 );
define( "WXID_WXBUTTON_MANAGE_MEDIA_ADD_DIRECTORY", 83 );
define( "WXID_WXDIALOG_MANAGE_DOWNLOADS", 84 );
define( "WXID_WXDATAVIEWTREECTRL_MANAGE_DOWNLOADS", 85 );
define( "WXID_WXBUTTON_MANAGE_DOWNLOADS_ADD_FILE", 86 );
define( "WXID_WXBUTTON_MANAGE_DOWNLOADS_RENAME", 87 );
define( "WXID_WXBUTTON_MANAGE_DOWNLOADS_DELETE", 88 );
define( "WXID_WXBUTTON_MANAGE_DOWNLOADS_ADD_DIRECTORY", 89 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_TESTSERVER_START", 90 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_TESTSERVER_STOP", 91 );
define( "WXID_MENU_MAIN_WINDOW_EXTRAS_SETTINGS", 92 );
define( "WXID_WXDIALOG_EXTRAS_SETTINGS", 93 );
define( "WXID_WXDIALOG_EXTRAS_SETTINGS_WXCHOICE_LANGUAGE", 94 );
define( "WXID_WXDIALOG_EXTRAS_SETTINGS_WXCHECKBOX_LAZY_SAVING", 95 );
define( "WXID_WXDIALOG_EXTRAS_SETTINGS_WXTEXTENTRY_WEBSERVER_PORT", 96 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_UPLOAD", 97 );
define( "WXID_MENU_MAIN_WINDOW_PROJECT_UPLOAD_SETTINGS", 98 );
define( "WXID_WXTEXTCTRL_MENU_MAIN_WINDOW_PROJECT_UPLOAD_SETTINGS_USERNAME", 99 );
define( "WXID_WXTEXTCTRL_MENU_MAIN_WINDOW_PROJECT_UPLOAD_SETTINGS_PASSWORD", 100 );
define( "WXID_WXTEXTCTRL_MENU_MAIN_WINDOW_PROJECT_UPLOAD_SETTINGS_SERVER", 101 );
define( "WXID_WXTEXTCTRL_MENU_MAIN_WINDOW_PROJECT_UPLOAD_SETTINGS_ABSPATH_SERVER", 102 );



// CONSTANTS FOR A WEBSITE PROJECT INSTANCE.
define( "WEBSITE_PROJECT_TEMPLATE_FILES", 1 );
define( "WEBSITE_PROJECT_MODULE_FILES", 2 );
define( "WEBSITE_PROJECT_CSS_FILES", 3 );
define( "WEBSITE_PROJECT_JAVASCRIPT_FILES", 4 );

define( "WEBSITE_PROJECT_CREATE_CSS_FILE", 1 );
define( "WEBSITE_PROJECT_CREATE_MODULE_FILE", 2 );
define( "WEBSITE_PROJECT_CREATE_TEMPLATE_FILE", 3 );
define( "WEBSITE_PROJECT_CREATE_JS_FILE", 4 );

define( "WEBSITE_PROJECT_TEMPLATE_FILE", 1 );
define( "WEBSITE_PROJECT_MODULE_FILE", 2 );
define( "WEBSITE_PROJECT_CSS_FILE", 3 );
define( "WEBSITE_PROJECT_JAVASCRIPT_FILE", 4 );


define( "EDITING_CONTAINER", 1 );
define( "EDITING_TEMPLATE", 2 );
define( "EDITING_MODULE", 3 );
define( "EDITING_JS", 4 );
define( "EDITING_CSS", 5 );

define( "MANAGING_MEDIA", 1 );
define( "MANAGING_DOWNLOADS", 2 );


// Upload settings file.
define( "UPLOAD_SETTINGS_FILE", "upload_settings.txt" );

// Name of the "psftp" file.
define( "PSFTP", "psftp.exe" );

// Name of the upload bat file:
define( "UPLOAD_BAT_FILE", "upload.bat" );

// Name of the upload routine file.
define( "UPLOAD_ROUTINE_FILE", "upload_routine.txt" );

?>
